package com.study;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/**
 * http://172.0.0.1:8082/actuator/hystrix.stream
 */
@SpringBootApplication
@EnableEurekaClient
@EnableCircuitBreaker
public class App {
	
	@Bean
	@LoadBalanced
    //负载均衡：默认为轮训
	public RestTemplate restTemplate() {
		return new RestTemplate();
	}
	
	public static void main(String[] args) {
		SpringApplication application = new SpringApplication(App.class);
		ConfigurableApplicationContext context = application.run(args);
		
		System.out.println("======================ribbon-withHystrix4：end=======================");
	}

}
